package com.uinnova.product.eam.mvc;

import com.binary.framework.web.RemoteResult;
import com.uinnova.product.eam.service.ArchReviewExpertConfService;
import com.uinnova.product.eam.vo.ArchReviewExpertConfInfo;
import com.uinnova.product.eam.vo.ArchReviewExpertSaveVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/arch/review/expert/conf")
public class ArchReviewExpertConfController {

    @Autowired
    private ArchReviewExpertConfService expertConfService;

    @PostMapping("/save")
    public RemoteResult save(@RequestBody List<ArchReviewExpertSaveVo> saveVos) {
        expertConfService.saveExpertConf(saveVos);
        return new RemoteResult("success");
    }

    @PostMapping("/checkPre")
    public RemoteResult checkPre(@RequestBody List<ArchReviewExpertSaveVo> saveVos) {
        expertConfService.checkPre(saveVos);
        return new RemoteResult("success");
    }

    @GetMapping("/info")
    public RemoteResult info() {
        List<ArchReviewExpertConfInfo> infos = expertConfService.expertConfInfo();
        return new RemoteResult(infos);
    }
}
